package dvx.mp.ivisual.desktop.ui.util;

import java.awt.Component;
import java.text.SimpleDateFormat;
import java.util.Calendar;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class GridCalendarRenderer extends DefaultTableCellRenderer {
	/***/
	private static final long serialVersionUID = 1L;
	
	@Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        
        SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy  hh:mm");
        Calendar cal = Calendar.getInstance();
        cal = (Calendar) value;
        
        this.setText(sdf.format(cal.getTime()));
        
        return this;
	}
}
